<script setup lang="ts">
import { storeToRefs } from 'pinia';

import { sysStatusDataStore } from '#/store';

const sysStatusData = sysStatusDataStore() as any;
const { checkPluginStatus } = storeToRefs(sysStatusData) as any;
function reloadWindow() {
  window.location.reload();
}
function gotoDownload() {
  window.open('https://doulingyang.cn');
}
</script>

<template>
  <div>
    <a-modal
      :visible="checkPluginStatus"
      @cancel="sysStatusData.checkPluginStatus = false"
      @ok="sysStatusData.checkPluginStatus = false"
    >
      <template #title>
        <a-space>
          <img
            alt=""
            src="https://wtplug.oss-cn-hangzhou.aliyuncs.com/webimages/logo192.png"
            style="width: 20px; height: 20px; margin-right: 5px"
          />
          未安装抖羚羊正版插件
        </a-space>
      </template>
      <template #footer>
        <a-space style="justify-content: center; width: 100%">
          <a-button type="primary" @click="gotoDownload()">
            前往下载安装
          </a-button>
          <a-button type="primary" @click="reloadWindow">
            我已安装，刷新
          </a-button>
          <a-button @click="sysStatusData.checkPluginStatus = false">
            下次安装
          </a-button>
        </a-space>
      </template>
      <div class="text-center" style="font-size: 16px; font-weight: 600">
        👏💐 欢迎使用抖羚羊分销 💐👏
      </div>
      <div class="text-center">安装正版抖羚羊插件，使用全部功能</div>
    </a-modal>
  </div>
</template>
